fix(sdl): expose limit/offset args on paginated list fields (#85)#98
Merged
Conversation
The SDL generator rendered paginated list fields without args while the
introspection path declared `limit` / `offset` — any client reading the
schema via SDL (codegen tools, AI agents, GraphiQL alternatives) could
not tell these fields were paginated, making the feature unreachable
for them. GraphQL spec requires field args to be declared in SDL.
Reuses `_is_paginated_relationship` to render paginated fields as
`{field}(limit: Int, offset: Int = 0): {Type}Result!`. Offset default
aligns with introspection's `defaultValue: "0"`.
Closes #85.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
allmonday
added a commit
that referenced
this pull request
Jul 2, 2026
Version bump for #98 (SDL generator now declares limit/offset args on paginated list fields, matching the introspection path). Updates CHANGELOG, pyproject.toml, uv.lock. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
enable_pagination=True时,SDL generator 给 paginated list 字段补上limit/offsetargs,与 introspection 路径对齐。{field}(limit: Int, offset: Int = 0): {Type}Result!。offset默认值0与 introspection 的defaultValue: "0"对齐。_is_paginated_relationship判定,non-paginated 字段渲染不变。Why
修复 #85。之前 SDL 和 introspection 对同一个 schema 给出不一致描述:introspection 给 paginated 字段加
limit/offset,SDL 不加。GraphQL 规范要求字段可接受的参数必须在 SDL 里声明——任何走 SDL 而不是 introspection 接 nexusx 的客户端(AI agent / codegen 工具 / GraphiQL 替代品 / 文档生成器)都看不到这些字段能传分页参数,分页功能对它们实际不可达。Test plan
TestSDLMixedPagination::test_paginated_field_exposes_limit_offset_args,锁sorted_kids(limit: Int, offset: Int = 0): SortedKidResult!test_paginated_list_renders_as_result_type:原断言sorted_kids: SortedKidResult!因新 args 失效,改为只断言类型后缀TestIntrospectionMixedPagination::test_paginated_field_uses_result_type_with_args形成对称覆盖tests/test_pagination_mixed.py8/8 通过Closes #85.